﻿<!DOCTYPE html>
<html lang="en-us">

<head>
    <title>免费券代申请</title>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <link rel="icon" href="favicon.ico" />
    <link href="css/bootstrap.min.css" rel="stylesheet" />
    <link href="css/font-awesome.min.css" rel="stylesheet" />
    <link href="css/default.css" rel="stylesheet" type="text/css" />
    <script src="js/jquery.min.js"></script>
    <script src="js/bootstrap/bootstrap.min.js"></script>
    <!--[if lt IE 9]>
      <script src="js/bootstrap/html5shiv.min.js"></script>
      <script src="js/bootstrap/respond.min.js"></script>
    <![endif]-->
    <!--页面加载进度条-->
    <link href="css/pace/dataurl.css" rel="stylesheet" />
    <script src="js/pace/pace.min.js"></script>
    <script src="js/jquery.scrolltopcontrol/scrolltopcontrol.js" type="text/javascript"></script>
    <script src="js/jquery.extend.js" type="text/javascript"></script>
    <!-- 加载菊花 -->
    <script src="js/spin/spin.js"></script>
    <script src="js/default.js" type="text/javascript"></script>
    <!-- 下拉菜单 -->
    <link href="./css/bootstrap-select/bootstrap-select.min.css" rel="stylesheet" />
    <script src="./js/bootstrap-select/bootstrap-select.min.js"></script>
    <script src="./js/bootstrap-select/i18n/defaults-zh_CN.min.js"></script>
    <script src="./js/bootstrap-select/bootstrap-select-custom.js"></script>
    <!-- 省市区 -->
    <script type="text/javascript" src="./js/cj-pcd/cj-pcd-1.0.1.min.js"></script>
    <script>
        // var BASEURL = 'http://192.168.31.250';
        var BASEURL = '';
        var applyInfo = {};
        const uploadTips = {
            idcardTip: "请选择身份证照片",
            idcardSuccess: "身份证上传成功",
            marriageTip: "请选择结婚证照片",
            marriageSuccess: "结婚证上传成功",
        }
        var option = {
            lines: 9, // 花瓣数目
            length: 1, // 花瓣长度
            width: 10, // 花瓣宽度
            radius: 15, // 花瓣距中心半径
            shadow: true,
            opacity: 1 / 8
        };

        var spinner = new Spinner(option);
        var steps = [];
        var stepIndex = 0;//进度步骤
        var personTypeId = 1;//免费类型id
        $(document).ready(function () {
            $('#idcard').show();
            $("#marriage_cert").hide();
            $('#military_cert').hide();
            $('#live_cert').hide();
            $('#other_desc').hide();
            $('#husband_idcard').hide();
//            $('#submitBtn').hide();
            resetSelect($('#province'), '', 10);
            //初始化进度条
            steps = $(".step");
            setStep(stepIndex);
            //初始化上传提示
            for (var i = 1; i < 8; i++) {
                setUploadStatus(i, 0);
            }
            //隐藏优惠券领取
            $('#couponBox').hide();
            $('#applyModal').on('hidden.bs.modal', function (e) {
                // window.location.reload();
            })

        })
        function addImg(type) {
            var fileId = '#file' + type;
            $(fileId).click()
        }
        function fileChange(type) {
            var fileId = '#file' + type;
            var imgPreviewId = '#imgPreview' + type;
            var imgFile = $(fileId)[0].files[0];
            var fr = new FileReader();
            fr.onload = function () {
                $(imgPreviewId).attr('src', fr.result);
            };
            fr.readAsDataURL(imgFile);
        }
        function setUploadStatus(type, status) {//status:1成功,0待上传
            var typeId;
            switch (type) {
                case 1:
                    typeId = 'idcard';
                    break;
                case 2:
                    typeId = '';
                    break;
                case 3:
                    typeId = 'marriage';
                    break;
                case 4:
                    typeId = 'husband';
                    break;
                case 5:
                    typeId = 'military';
                    break;
                case 6:
                    typeId = 'live';
                    break;
                case 7:
                    typeId = 'household';
                    break;
                default:
            }
            if (typeId) {
                if (status === 1) {
                    $('.' + typeId + '_success').show();
                    $('.' + typeId + '_sel').hide();
                } else {
                    $('.' + typeId + '_success').hide();
                    $('.' + typeId + '_sel').show();
                }
            }
        }
        function upload(type) {//type: 1身份证 2身份证背面-暂不上传 3结婚证 4丈夫身份证 5军官证 6居住证 7户口本
            var fileId = '#file' + type;
            const formData = new FormData();
            var fileData = $(fileId)[0].files[0]
            if (!fileData) {
                alert('请添加证件照片!')
                return;
            }
            //验证手机号码格式
            var pattern2 = /^1[3456789]\d{9}$/;
            var mobNo2 = pattern2.test($('.mobile').val());
            if(!mobNo2){
                alert('请输入正确的手机号码！');
                return false;
            }
            formData.append('mobile', $('.mobile').val());
            formData.append('file', fileData);
            var target = document.getElementById('uploadForm' + type);
            spinner.spin(target);
            formData.append("imgType", type);
            formData.append('presonType', personTypeId);
            if (applyInfo.id) {
                formData.append('id', applyInfo.id);
            }
            $.ajax({
                url: BASEURL + "/csfy/intf.do?method=imageUpload",
                type: "POST",
                data: formData,
                timeout: 150000,
                processData: false,
                contentType: false,
                success: function (data) {
                    var alertMsg = data.msg ==='success'?'上传成功':data.msg;
                    alert(alertMsg);
                    if (data.rows) {
                        setUploadStatus(type, 1);
                        switch (type) {
                            case 1:
                                applyInfo.name = data.rows.name;
                                $('#idcard_name').text(data.rows.name);
                                applyInfo.sex = data.rows.sex;
                                $('#idcard_sex').text(data.rows.sex);
                                applyInfo.nation = data.rows.nation;
                                $('#idcard_nation').text(data.rows.nation);
                                applyInfo.birth = data.rows.birth;
                                $('#idcard_birth').text(data.rows.birth);
                                applyInfo.address = data.rows.address;
                                $('#idcard_address').text(data.rows.address);
                                applyInfo.cardFrontImgUrl = data.rows.cardFrontImgUrl;
                                applyInfo.selfId = data.rows.id;//个人身份证id
                                applyInfo.id = data.rows.id;//用户信息id
                                $('#idcard_id').text(data.rows.id);
                                break;
                            case 2:
                                applyInfo.cardBackImgUrl = data.rows.cardBackImgUrl;
                                break;
                            case 3:
                                applyInfo.marriageImgUrl = data.rows.marriageImgUrl;
                                break;
                            case 4:
                                applyInfo.cardMateImgUrl = data.rows.cardMateImgUrl;
                                applyInfo.husbandId = data.rows.id;
                                break;
                            case 5:
                                applyInfo.officerImgUrl = data.rows.officerImgUrl;
                                applyInfo.militaryId = data.rows.id;
                                if (!applyInfo.selfId) {
                                    applyInfo.id = data.rows.id;
                                }
                                break;
                            case 6:
                                applyInfo.name = data.rows.name;
                                $('#live_name').text(data.rows.name);
                                applyInfo.sex = data.rows.sex;
                                $('#live_sex').text(data.rows.sex);
                                applyInfo.nation = data.rows.nation;
                                $('#live_nation').text(data.rows.nation);
                                applyInfo.birth = data.rows.birth;
                                $('#live_birth').text(data.rows.birth);
                                applyInfo.address = data.rows.address;
                                $('#live_address').text(data.rows.address);
                                applyInfo.residencePermitImgUrl = data.rows.residencePermitImgUrl;
                                applyInfo.liveId = data.rows.id;
                                applyInfo.id = data.rows.id;
                                $('#live_id').text(data.rows.id);
                                break;
                            default:
                        }
                        checkUploadStep();
                    }
                    spinner.spin();
                },
                error: function (err) {
                    alert('网络错误!');
                    spinner.spin();
                }
            });
        }
        function checkUploadStep() {
            switch (personTypeId) {
                case 1:
                    if (!applyInfo.cardFrontImgUrl) {
                        return false;
                    }
                    break;
                case 2:
                    if (!applyInfo.cardFrontImgUrl || !applyInfo.cardMateImgUrl || !applyInfo.marriageImgUrl) {
                        return false;
                    }
                    break;
                case 3:
                    if (!applyInfo.officerImgUrl) {
                        return false;
                    }
                    break;
                case 4:
                    if (!applyInfo.cardFrontImgUrl || !applyInfo.officerImgUrl || !applyInfo.marriageImgUrl) {
                        return false;
                    }
                    break;
                case 5:
                    if (!applyInfo.cardFrontImgUrl || !applyInfo.residencePermitImgUrl) {
                        return false;
                    }
                    break;
                case 6:
                    if (!applyInfo.cardFrontImgUrl) {
                        return false;
                    }
                    break;
                default:
            }
            stepIndex = 1;
            setStep(1);
            if (couponInfos.length == 0 && unreceivedCouponInfos.length == 0) {
                $('#submitBtn').show();
            }
            return true;
        }
        function checkFormStep() {
            stepIndex = 2;
            setStep(2);
        }
        function confirm() {
            var applyInfo = window.applyInfo || {};
            const data = {
                name: applyInfo.name,
                sex: 1,
                nation: applyInfo.nation,
                birth: applyInfo.birth,
                id: applyInfo.id,
                address: applyInfo.address,
                imageUrl: applyInfo.imageUrl,
                presonType: 1,
                permanentAddr: '湖南省,长沙市,长沙县'
            };
            $.ajax({
                url: BASEURL + "/csfy/intf.do?method=savePresonInfo",
                type: "post",
                data: data,
                timeout: 150000,
                dataType: "json",
                success: function (data) {
                    alert(data.msg);
                    if (data.rows) {

                    }
                },
                error: function (err) {
                    alert('网络错误!');
                }

            });
        }
        //优惠券选择
        function couponSel(id) {
            var checkId = '#customCheck' + id;
            $(checkId).trigger('click');
        }
        //省市区
        function resetSelect(jq, parentId, defaultIdx) {
            var url = BASEURL+'/csfy/intf.do?method=getAddrs';
            if (parentId) {
                url = url + '&parentId=' + parentId;
            }
            var jqId = '#' + jq.attr('id');
            $.getJSON(url, function (data) {
                if (data.msg === 'success') {
                    jq.empty();
                    $.each(data.rows, function (i, item) {
                        var option = $('<option></option>');
                        option.attr('value', item['code']);
                        option.text(item['name']);
                        jq.append(option);
                    });
                    if (defaultIdx) {
                        jq.get(0).selectedIndex = defaultIdx;
                    }

                    if (jqId) {
                        addressChange(jqId);
                    }
                    jq.selectpicker('refresh');
                }
            });
        }
        function addressChange(id) {
            var code = $(id).children('option:selected').attr('value')
            switch (id) {
                case '#province':
                    {
                        var defaultIdx = undefined;
                        if (code == 43) {
                            defaultIdx = 8;
                        }
                        resetSelect($('#city'), code, defaultIdx);
                        $('#county').empty();
                        $('#town').empty();
                        $('#county').selectpicker('refresh');
                        $('#town').selectpicker('refresh');
                        break;
                    }
                case '#city':
                    {
                        resetSelect($('#county'), code);
                        $('#town').empty();
                        $('#town').selectpicker('refresh');
                        break;
                    }
                case '#county':
                    {
                        resetSelect($('#town'), code);
                        break;
                    }
                case '#town':
                    {
                        break;
                    }
            }
        }

        function pregnancyChange() {
            var type = $('#pregnancy').children('option:selected').val();
            var typeId = $('#pregnancy').children('option:selected').attr('type_id');
            var pregnancy = typeId;
            applyInfo.pregnancy = pregnancy;
        }
        var couponInfos = [];//已领取
        var unreceivedCouponInfos = [];//未领取
        function submit() {
            var pattern2 = /^1[3456789]\d{9}$/;
            var mobNo2 = pattern2.test($('.mobile').val());
            if(!mobNo2){
                alert('请输入正确的手机号码！');
                return false;
            }
            if(applyInfo.id == undefined){
                var pattern = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
                var mobNo = pattern.test($('.idCard').val());
                if(!mobNo){
                    alert('请输入正确的身份证号码！');
                    return false;
                }
                var postData = {
                    name:$('.personName').val(),
                    nation:$('.minzu').val(),
                    id:$('.idCard').val(),
                    address:$('.hjAddress').val(),
                    presonType:personTypeId,
                    province:$('#province option:selected').text(),
                    city:$('#city option:selected').text(),
                    country:$('#county option:selected').text(),
                    town:$('#town option:selected').text(),
                    mobile:$('.mobile').val()
                }
                console.log(postData);
                if(postData.name == ''){
                    alert("请输入姓名！");
                    return false;
                }
                if(postData.nation == ''){
                    alert("请输入民族！");
                    return false;
                }
                if(postData.id == ''){
                    alert("请输入身份证号码！");
                    return false;
                }
                if(postData.address == ''){
                    alert("请输入户籍地址！");
                    return false;
                }
                applyInfo.id = $(".idCard").val();
                $.ajax({
                    url: BASEURL + "/csfy/intf.do?method=savePresonInfo",
                    type: "post",
                    data: postData,
                    timeout: 150000,
                    dataType: "json",
                    success: function (data) {
                        if (data.msg === 'success') {
                            var url = BASEURL + '/csfy/intf.do?method=getDetailPresonInfo&type=' + personTypeId + '&id=' + applyInfo.id;
                            $.ajax({
                                url: url,
                                type: "post",
                                data: {},
                                timeout: 150000,
                                dataType: "json",
                                processData: false,
                                contentType: false,
                                success: function (data) {
                                    if (data.msg === 'success') {
                                        unreceivedCouponInfos = data.rows.unreceivedCouponInfos;
                                        couponInfos = data.rows.couponInfos;
                                        refreshCouponInfos(unreceivedCouponInfos, 0);
                                        refreshCouponInfos(couponInfos, 1);
                                        $('#submitBtn').hide();
                                        $('#couponBox').show();
                                    } else {
                                        alert('抱歉,出错了');
                                    }
                                },
                                error: function (err) {
                                    alert('网络错误!');
                                }
                            });
                        }
                    },
                    error: function (err) {
                        alert('网络错误!');
                    }

                });
            }else {
                if (!applyInfo.id) {
                    alert('请正确上传证件信息!');
                    return false;
                }
                var url = BASEURL + '/csfy/intf.do?method=getDetailPresonInfo&type=' + personTypeId + '&id=' + applyInfo.id;

                $.ajax({
                    url: url,
                    type: "post",
                    data: {},
                    timeout: 150000,
                    dataType: "json",
                    processData: false,
                    contentType: false,
                    success: function (data) {
                        if (data.msg === 'success') {
                            unreceivedCouponInfos = data.rows.unreceivedCouponInfos;
                            couponInfos = data.rows.couponInfos;
                            refreshCouponInfos(unreceivedCouponInfos, 0);
                            refreshCouponInfos(couponInfos, 1);
                            $('#submitBtn').hide();
                            $('#couponBox').show();
                        } else {
                            alert('抱歉,出错了');
                        }
                    },
                    error: function (err) {
                        alert('网络错误!');
                    }
                });
            }
        }
        function refreshCouponInfos(couponInfos, status) {//status:0未领取列表,1已领取列表
            if (status == 0) {
                var couponsStr = '';
                for (const key in couponInfos) {
                    var coupon = couponInfos[key];
                    if (coupon) {
                        if(coupon.type !=6 && coupon.type !=3){//屏蔽地中海和HPV
                            var imgStr = `<img onclick="couponSel(${key})" style="width:400px;height:100px;" src="${coupon.couponImg}" data-src="holder.js/400x100" alt="" class="custom-control-label"></img>`;
                            var lingqu = '<div style="width:100px;margin-left:auto;margin-right:auto;"><button class="btn btn-primary" id="applyBtn" onclick="apply(' + coupon.type +')" style="cursor:pointer;" type="button">领取</button></div>';
                            var lineStr = '<div style="height:10px;"></div>';
                            couponsStr = couponsStr + imgStr + lingqu + lineStr;
                        }
                    }
                }
                if (!couponInfos || couponInfos.length == 0) {
                    $('#applyBtn').hide();
                    couponsStr = '<div>无可领取的免费券</div>';
                }
                $('#couponInfos').html(couponsStr);
            } else {
                var couponsStr = '';
                for (const key in couponInfos) {
                    var coupon = couponInfos[key];
                    if (coupon) {
                        if(coupon.type !=6 && coupon.type !=3){//屏蔽地中海和HPV
                            var imgStr = `<img onclick="couponSel(${key})" style="width:400px;height:100px;" src="${coupon.couponImg}" data-src="holder.js/400x100" alt="" class="custom-control-label"></img>`;
                            var lineStr = '<div style="height:10px;"></div>';
                            couponsStr = couponsStr + imgStr + lineStr;
                        }
                    }
                }
                $('#couponInfos_received').html(couponsStr);
            }
        }
        var couponLabels = ['HPV免费券', 'NIPT免费券', '产前血清学筛查', '新生儿疾病筛查', '耳聋基因检测'];
        var jtype = '';//优惠劵类型
        var userId = '';//用户身份证
        function apply(type) {
            console.log(type);
            console.log(applyInfo);
            jtype = type;
            userId = applyInfo.id;
            var tip = '您已为本地常住居民代领免费券:';
            if(type == '3'){
                $.ajax({
                    url: BASEURL + "/csfy/intf.do?method=addCouponInfo&type=" + type + '&id=' + applyInfo.id,
                    type: "post",
                    data: {},
                    timeout: 150000,
                    dataType: "json",
                    processData: false,
                    contentType: false,
                    success: function (data) {
                        if (data.msg === 'success') {
                            checkUploadStep();
                            submit();
                            $('#modalTip').text('您已为本地常住居民代领免费券');
                            $('#applyModal').modal('show');
                        } else {
                            alert('抱歉,出错了');
                        }
                    },
                    error: function (err) {
                        alert('网络错误!');
                    }
                });
            }else {
                $(".zhezhao").css('display','block');
                $(".alertDiv").css('display','block');
            }
            if(type == '1' || type == '5'){
                $(".taishu").css('display','block');
            }
        }
        //弹窗确定领取优惠券
        function commit() {
            var taishu = taishu = $('#pregnancy').children('option:selected').attr('type_id');
            var dateStr = $('.yjDate').val();
            if((jtype == '1' || jtype == '5') && taishu == ''){
                alert("请选择胎数");
                return false;
            }
            if((jtype == '2' || jtype == '4' || jtype == '6') && dateStr == ''){
                alert("请输入末次月经时间");
                return false;
            }
            if(jtype == '2' || jtype == '4' || jtype == '6'){
                taishu = '';
            }
            console.log("jtype:"+jtype+"----"+"userId:"+userId+"----"+"taishu:"+taishu+"----"+"lmp:"+dateStr);
            $.ajax({
                url: BASEURL + "/csfy/intf.do?method=addCouponInfo&type=" + jtype + '&id=' + userId + '&num=' + taishu + '&lmp=' + dateStr,
                type: "post",
                data: {},
                timeout: 150000,
                dataType: "json",
                processData: false,
                contentType: false,
                success: function (data) {
                    if (data.msg === 'success') {
                        checkUploadStep();
                        submit();
                        $(".zhezhao").css('display','none');
                        $(".alertDiv").css('display','none');
                        $(".taishu").css('display','none');
                        $('#modalTip').text('您已为本地常住居民代领免费券');
                        $('#applyModal').modal('show');
                    } else {
                        alert('抱歉,出错了');
                    }
                },
                error: function (err) {
                    alert('网络错误!');
                }
            });
        }
        //关闭遮罩
        function closeZhezhao() {
            $(".zhezhao").css('display','none');
            $(".alertDiv").css('display','none');
            $(".taishu").css('display','none');
        }
        function couponTypeChange() {
            var type = $('#couponType').children('option:selected').val();
            var typeId = $('#couponType').children('option:selected').attr('type_id');
            personTypeId = typeId;
            switch (typeId) {
                case "1":
                    {
                        $('#idcard').show();
                        $("#marriage_cert").hide();
                        $('#military_cert').hide();
                        $('#live_cert').hide();
                        $('#other_desc').hide();
                        $('#husband_idcard').hide();
                        $('#household_register').show();
                        $('#address_tip').show();
                        break;
                    }
                case "2":
                    {
                        $('#idcard').show();
                        $("#marriage_cert").show();
                        $('#military_cert').hide();
                        $('#live_cert').hide();
                        $('#other_desc').hide();
                        $('#husband_idcard').show();
                        $('#household_register').show();
                        $('#address_tip').show();
                        break;
                    }
                case "6":
                    {
                        $('#idcard').hide();
                        $("#marriage_cert").hide();
                        $('#military_cert').show();
                        $('#live_cert').hide();
                        $('#other_desc').hide();
                        $('#husband_idcard').hide();
                        $('#household_register').hide();
                        $('#address_tip').hide();
                        break;
                    }
                case "4":
                    {
                        $('#idcard').show();
                        $("#marriage_cert").show();
                        $('#military_cert').hide();
                        $('#live_cert').hide();
                        $('#other_desc').hide();
                        $('#husband_idcard').show();
                        $('#household_register').hide();
                        $('#address_tip').hide();
                        break;
                    }
                case "3":
                    {
                        $('#idcard').hide();
                        $("#marriage_cert").hide();
                        $('#military_cert').hide();
                        $('#live_cert').show();
                        $('#other_desc').hide();
                        $('#husband_idcard').hide();
                        $('#household_register').hide();
                        $('#address_tip').hide();
                        break;
                    }
                case "5":
                    {
                        $('#idcard').show();
                        $("#marriage_cert").hide();
                        $('#military_cert').hide();
                        $('#live_cert').hide();
                        $('#other_desc').show();
                        $('#husband_idcard').hide();
                        $('#household_register').hide();
                        $('#address_tip').hide();
                        break;
                    }
                default:
                    {

                    }
            }
        }
        // 进度条
        $(".step-icon").click(function () {
            var me = this;
            stepIndex = $(me).parents(".step").index();
            setStep(stepIndex);
        });
        function setStep(stepIdx) {
            $(steps).removeClass("is-sucess");
            $(steps).removeClass("last-sucess");
            for (var i = 0; i <= stepIdx; i++) {
                var step = steps[i];
                if (i < stepIdx) {
                    $(step).addClass("is-sucess");
                }
                else {
                    $(step).addClass("last-sucess");
                }
            }
        }
        function clearSteps() {
            stepIndex = -1;
            setStep(stepIndex);
        }
        function addStep(addnum) {
            if (!addnum) { addnum = 1 }
            stepIndex += addnum;
            setStep(stepIndex);
        }
    </script>
    <style type="text/css">
        .title {
            background: #dfdfdf;
        }

        /* 进度条 */

        .step {
            position: relative;
            vertical-align: top;
            display: inline-block;
            width: 30%;
        }

        .step-head {
            width: 30px;
            height: 30px;
            border-radius: 50%;
            line-height: 31px;
            text-align: center;
            vertical-align: top;
            color: #bfcbd9;
            font-size: 14px;
            border: 2px solid #bfcbd9;
            z-index: 10000;
        }

        .step-main {
            font-size: 15px;
            color: #48576a;
        }

        .step-line {
            position: absolute;
            top: 15px;
            height: 2px;
            left: 32px;
            right: 0px;
            display: inline-block;
            background-color: #bfcbd9;
            z-index: 10000;
        }

        .step-circle {
            margin: auto;
            width: 26px;
            height: 26px;
            border-radius: 50%;
            background-color: #ffffff;
            text-align: center;
            padding: -10px 0 0 0;
        }

        .step-index {
            text-align: center;
            position: relative;
            top: -3px;
        }

        .is-sucess>.step-head {
            color: #ffffff;
            border-color: #ffffff;
        }

        .is-sucess>.step-head .step-circle {
            background-color: #00acac;
        }

        .is-sucess>.step-head>.step-line {
            background-color: #00acac;
        }

        .last-sucess>.step-head {
            color: #ffffff;
            border-color: #ffffff;
        }

        .last-sucess>.step-head .step-circle {
            background-color: #00acac;
        }
        .userInfo{
            display: flex;
        }
        .userInfo div{
            flex: 1;
            padding: 30px 0;
        }
        .userInfo div input,select{
            width: 180px;
            height: 30px;
            border: 1px solid #ddd;
            border-radius: 5px;
            outline: none;
        }

        /* 进度条结束 */
    </style>
</head>

<body>
        <div class="maincontent row">
            <div class="col-sm-12">
                <ul class="breadcrumb">
                    <li class="active">免费券代申请</li>
                </ul>
                <ul class="list-group">
                    <li class="list-group-item">
                        <div class="steps">
                            <div class="step">
                                <div class="step-head">
                                    <div class="step-line"></div>
                                    <div class="step-icon">
                                        <div class="step-circle">
                                            <div class="step-index">1</div>
                                        </div>
                                    </div>
                                </div>
                                <div class="step-main">
                                    填写基本信息
                                </div>
                            </div>
                            <div class="step">
                                <div class="step-head">
                                    <div class="step-line"></div>
                                    <div class="step-icon">
                                        <div class="step-circle">
                                            <div class="step-index">2</div>
                                        </div>
                                    </div>
                                </div>
                                <div class="step-main">
                                    上传证件
                                </div>
                            </div>
                            <div class="step">
                                <div class="step-head">
                                    <div class="step-icon">
                                        <div class="step-circle">
                                            <div class="step-index">3</div>
                                        </div>
                                    </div>
                                </div>
                                <div class="step-main">
                                    填写送检单
                                </div>
                            </div>
                        </div>
                    </li>
                </ul>
                <ul class="list-group">
                    <li class="list-group-item title">
                        1.基本信息
                    </li>
                    <li class="list-group-item">
                        <div class="form-inline">
                            <label>证件号码</label>
                            <input style="width:450px;" id="other_input" type="text" class="form-control" placeholder="已通过验证的身份证/居住证/丈夫身份证号码带出证件信息">
                        </div>
                    </li>
                    <li class="list-group-item">
                        请填写户口本地址或居住证地址
                        <div class="row">
                            <div class="col-md-3">
                                <div class="form-inline">
                                    <label style="display:inline-block;">省</label>
                                    <div style="display:inline-block;">
                                        <select id="province" onchange="addressChange('#province')" class="selectpicker form-control" data-live-search="true" data-max-options="1">
                                            <option value="">请选择</option>
                                        </select>
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-3">
                                <div class="form-inline">
                                    <label style="display:inline-block;">市</label>
                                    <div style="display:inline-block;">
                                        <select id="city" onchange="addressChange('#city')" class="selectpicker form-control" data-live-search="true" data-max-options="1">
                                            <option value="">请选择</option>
                                        </select>
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-3">
                                <div class="form-inline">
                                    <label style="display:inline-block;">区/县</label>
                                    <div style="display:inline-block;">
                                        <select id="county" onchange="addressChange('#county')" class="selectpicker form-control" data-live-search="true" data-max-options="1">
                                            <option value="">请选择</option>
                                        </select>
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-3">
                                <div class="form-inline row">
                                    <label style="display:inline-block;">乡镇/街道</label>
                                    <div style="display:inline-block;">
                                        <select id="town" onchange="addressChange('#town')" class="selectpicker form-control" data-live-search="true" data-max-options="1">
                                            <option value="">请选择</option>
                                        </select>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </li>
                    <li class="list-group-item">
                        <div class="row">
                            <div class="col-md-4">
                                <div class="form-inline">
                                    <label>选择免费类型</label>
                                    <select onchange="couponTypeChange()" id="couponType" class="form-control">
                                        <option type_id="1">本人户口为长沙户口</option>
                                        <option type_id="2">丈夫户口为长沙户口</option>
                                        <!-- <option type_id="4">常驻长沙军官或夫妻关系</option> -->
                                        <option type_id="3">女方拥有长沙市居住证</option>
                                        <!-- <option type_id="5">其他</option> -->
                                    </select>
                                </div>
                            </div>
                            <div id="other_desc" class="col-md-4">
                                <div class="form-inline">
                                    <label>其他说明</label>
                                    <input id="other_input" type="text" class="form-control" placeholder="请输入其他情况描述">
                                </div>
                            </div>
                            <div style="color:#ff0000;padding-top:5px;" id="address_tip">
                                提示：请填写常住地址为户口本地址！
                            </div>
                        </div>
                    </li>
                </ul>
                <ul class="list-group">
                    <li class="list-group-item title">
                        2.上传证件
                    </li>
                    <li class="userInfo">
                        <div>
                            <span><span style="color: red">*</span>　　姓名：</span>
                            <input type="text" class="personName" placeholder="请输入姓名">
                        </div>
                        <div>
                            <span><span style="color: red">*</span>身份证号码：</span>
                            <input type="text" class="idCard" placeholder="请输入身份证号码">
                        </div>
                        <div>
                            <span><span style="color: red">*</span>民族：</span>
                            <input type="text" class="minzu" placeholder="请输入">
                        </div>
                    </li>
                    <li class="userInfo">
                        <div style="padding-top: 0px">
                            <span><span style="color: red">*</span>手机号码：</span>
                            <input type="text" class="mobile" placeholder="请输入手机号码">
                        </div>
                        <div style="padding-top: 0px">
                            <span><span style="color: red">*</span>户籍地址：</span>
                            <input type="text" style="width: 300px" class="hjAddress" placeholder="请输入户籍地址">
                        </div>
                        <div></div>
                    </li>
                    <li id="idcard" class="list-group-item">
                        <div class="row">
                            <div class="col-sm-6 col-md-4" id="uploadForm1">
                                <span style="color:#00ff00;" class="glyphicon glyphicon-ok idcard_success" aria-hidden="true"></span>
                                <label class="idcard_success">身份证上传成功</label>
                                <label class="idcard_sel">请选择身份证照片</label>
                                <input id="file1" onchange="fileChange(1)" type="file" style="display:none;" />
                                <div class="thumbnail" onclick="addImg(1)">
                                    <div style="height:180px;width:100%;">
                                        <img style="height:100%;width:100%;" id="imgPreview1" data-src="holder.js/300x200" alt="点击选择身份证照片">
                                    </div>
                                </div>
                                <button class="btn btn-primary" id="upload1" onclick="upload(1)" style="cursor:pointer;" type="button">上传</button>
                            </div>
                            <div class="col-sm-6 col-md-4">
                                <label>身份证照片示例</label>
                                <div class="thumbnail" style="height:80%;width:80%;">
                                    <div style="height:150px;width:100%;">
                                        <img style="height:100%;width:100%;" src="./image/idcardSample.png" data-src="holder.js/300x200" alt="">
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-6 col-md-4" id="idCardAR">
                                <div>姓名: <span id="idcard_name"></span></div>
                                <div>性别: <span id="idcard_sex"></span></div>
                                <div>民族: <span id="idcard_nation"></span></div>
                                <div>生日: <span id="idcard_birth"></span></div>
                                <div>身份证地址: <span id="idcard_address"></span></div>
                                <div>身份证号: <span id="idcard_id"></span></div>
                            </div>
                        </div>
                    </li>
                    <li id="marriage_cert" class="list-group-item">
                        <div class="row">
                            <div class="col-sm-6 col-md-4" id="uploadForm3">
                                <span style="color:#00ff00;" class="glyphicon glyphicon-ok marriage_success" aria-hidden="true"></span>
                                <label class="marriage_success">结婚证上传成功</label>
                                <label class="marriage_sel">请选择结婚证照片</label>
                                <input id="file3" onchange="fileChange(3)" type="file" style="display:none;" />
                                <div class="thumbnail" onclick="addImg(3)">
                                    <div style="height:180px;width:100%;">
                                        <img style="height:100%;width:100%;" id="imgPreview3" data-src="holder.js/300x200" alt="点击选择结婚证照片">
                                    </div>
                                </div>
                                <button class="btn btn-primary" id="upload3" onclick="upload(3)" style="cursor:pointer;" type="button">上传</button>
                            </div>
                            <div class="col-sm-6 col-md-4">
                                <label>结婚证照片示例</label>
                                <div class="thumbnail" style="height:80%;width:80%;">
                                    <div style="height:150px;width:100%;">
                                        <img style="height:100%;width:100%;" src="image/jhzSample.jpg" data-src="holder.js/300x200" alt="">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </li>
                    <li id="husband_idcard" class="list-group-item">
                        <div class="row">
                            <div class="col-sm-6 col-md-4" id="uploadForm4">
                                <span style="color:#00ff00;" class="glyphicon glyphicon-ok husband_success" aria-hidden="true"></span>
                                <label class="husband_success">丈夫身份证上传成功</label>
                                <label class="husband_sel">请选择丈夫身份证照片</label>
                                <input id="file4" onchange="fileChange(4)" type="file" style="display:none;" />
                                <div class="thumbnail" onclick="addImg(4)">
                                    <div style="height:180px;width:100%;">
                                        <img style="height:100%;width:100%;" id="imgPreview4" data-src="holder.js/300x200" alt="点击选择丈夫身份证照片">
                                    </div>
                                </div>
                                <button class="btn btn-primary" id="upload4" onclick="upload(4)" style="cursor:pointer;" type="button">上传</button>
                            </div>
                            <div class="col-sm-6 col-md-4">
                                <label>丈夫身份证照片示例</label>
                                <div class="thumbnail" style="height:80%;width:80%;">
                                    <div style="height:150px;width:100%;">
                                        <img style="height:100%;width:100%;" src="image/idcardSample.png" data-src="holder.js/300x200" alt="">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </li>
                    <li id="live_cert" class="list-group-item">
                        <div class="row">
                            <div class="col-sm-6 col-md-4" id="uploadForm6">
                                <span style="color:#00ff00;" class="glyphicon glyphicon-ok live_success" aria-hidden="true"></span>
                                <label class="live_success">居住证上传成功</label>
                                <label class="live_sel">请选择居住证照片</label>
                                <input id="file6" onchange="fileChange(6)" type="file" style="display:none;" />
                                <div class="thumbnail" onclick="addImg(6)">
                                    <div style="height:180px;width:100%;">
                                        <img style="height:100%;width:100%;" id="imgPreview6" data-src="holder.js/300x200" alt="点击选择居住证照片">
                                    </div>
                                </div>
                                <button class="btn btn-primary" id="upload6" onclick="upload(6)" style="cursor:pointer;" type="button">上传</button>
                            </div>
                            <div class="col-sm-6 col-md-4">
                                <label>居住证照片示例</label>
                                <div class="thumbnail" style="height:80%;width:80%;">
                                    <div style="height:150px;width:100%;">
                                        <img style="height:100%;width:100%;" src="image/jzzSample.jpg" data-src="holder.js/300x200" alt="">
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-6 col-md-4" id="idCardAR">
                                <div>姓名: <span id="live_name"></span></div>
                                <div>性别: <span id="live_sex"></span></div>
                                <div>民族: <span id="live_nation"></span></div>
                                <div>生日: <span id="live_birth"></span></div>
                                <div>身份证地址: <span id="live_address"></span></div>
                                <div>身份证号: <span id="live_id"></span></div>
                            </div>
                        </div>
                    </li>
                    <li id="household_register" class="list-group-item">
                        <div class="row">
                            <div class="col-sm-6 col-md-4" id="uploadForm7">
                                <span style="color:#00ff00;" class="glyphicon glyphicon-ok household_success" aria-hidden="true"></span>
                                <label class="household_success">户口本上传成功</label>
                                <label class="household_sel">请选择长沙市户口本照片</label>
                                <input id="file7" onchange="fileChange(7)" type="file" style="display:none;" />
                                <div class="thumbnail" onclick="addImg(7)">
                                    <div style="height:180px;width:100%;">
                                        <img style="height:100%;width:100%;" id="imgPreview7" data-src="holder.js/300x200" alt="点击选择户口本照片">
                                    </div>
                                </div>
                                <button class="btn btn-primary" id="upload7" onclick="upload(7)" style="cursor:pointer;" type="button">上传</button>
                            </div>
                            <div class="col-sm-6 col-md-4">
                                <label>户口本照片示例</label>
                                <div class="thumbnail" style="height:80%;width:80%;">
                                    <div style="height:150px;width:100%;">
                                        <img style="height:100%;width:100%;" src="image/hkbSample.jpg" data-src="holder.js/300x200" alt="">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </li>
                    <li class="list-group-item">
                        <div style="width:100px;margin-left:auto;margin-right:auto;">
                            <button class="btn btn-primary" id="submitBtn" onclick="submit()" style="cursor:pointer;" type="button">提交</button>
                        </div>
                        <div id="couponBox" class="row">
                            <div style="color:#ffa035;margin:10px;">已领取的免费券。</div>
                            <div class="col-sm-6 col-md-6">
                                <div id="couponInfos_received" class="custom-control custom-checkbox">

                                </div>
                            </div>
                            <div style="color:#ffa035;margin:10px;">您所在的常住地居民可享有以下免费券，请根据需要选择领取。</div>
                            <div class="col-sm-6 col-md-6">
                                <div id="couponInfos" class="custom-control custom-checkbox">

                                </div>
                            </div>
                            <div class="zhezhao" onclick="closeZhezhao()" style="position:fixed;left:0;top:0;bottom:0;right:0;background:#000;opacity:0.5;display: none"></div>
                            <div class="alertDiv" style="display: none;height: 200px;border:1px solid #eee;width:300px;position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);background:#fff;border-radius:10px;text-align:center">
                                <div class="taishu" style="display: none;margin-top: 20px">
                                    <label>胎数：</label>
                                    <select onchange="pregnancyChange()" id="pregnancy" class="form-control" style="display: inline-block;width: 150px">
                                        <option type_id="">请选择</option>
                                        <option type_id="1">单胎</option>
                                        <option type_id="2">双胎</option>
                                        <option type_id="3">三胎</option>
                                    </select>
                                </div>
                                <div style="margin:20px 0">
                                    <label>末次月经时间：</label><input type="date" class="yjDate" style="border:1px solid #eee;width:150px;height:30px;text-align:center"/>
                                </div>
                                <button style="width:90px;margin:30px auto 0 auto" onclick="commit()">确定</button>
                            </div>
                        </div>
                    </li>
                </ul>
                <ul class="list-group" style="display:none;">
                    <li class="list-group-item title">
                        3.填写送检单
                    </li>
                    <li class="list-group-item">
                        <div style="width:140px;margin-left:auto;margin-right:auto;">
                            <button class="btn btn-primary" id="confirm" onclick="confirm()" style="cursor:pointer;" type="button">填写送检单</button>
                        </div>
                    </li>
                </ul>
            </div>
            <!--主要内容-->
        </div>
    <a href="#top" id="goTop">
        <i class="fa fa-angle-up fa-3x"></i>
    </a>
    <!-- Modal -->
    <div class="modal fade" id="applyModal" tabindex="-1" role="dialog" aria-labelledby="applyModalTitle" aria-hidden="true">
        <div style="margin-top:200px;" class="modal-dialog modal-dialog-centered" role="document">
            <div class="modal-content">
                <div class="modal-body">
                    <div style="background-color:green;height:50px;width:50px;margin:auto;border-radius: 50%;">
                        <span style="font-size:28px;color:#ffffff;display:block;text-align:center;padding-top:8px;" class="glyphicon glyphicon-ok"></span>
                    </div>
                    <div id="modalTip" style="margin-top:10px;">您已为本地常住居民代领免费券</div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-primary" style="display:block;margin-left:auto;margin-right:auto;" data-dismiss="modal">确定</button>
                </div>
            </div>
        </div>
    </div>
    <script>
        //获取当前登录用户信息
        $(document).ready(function () {
            $.ajax({
                method: 'POST',
                url: '/csfy/intf.do',
                data: { method: 'getLoginUserInfo' },
                success: res => {
                    if (res.code == 10086) {
//                        window.location.href = "/csfy/index.do"
                        alert("请重新登录！");
                    } else {
                        if (res.code == 200) {
                            $(".username").html(res.rows.userName);
                        }
                    }
                }
            })
        })
    </script>
</body>

</html>